<template>
	<view class="empty-view">
		<image :src="getAppImg('empty-02.png')" class="ioc"></image>
		<view class="text-view" v-if="texts.length">
			<text class="empty-text" v-for="(item,index) in texts" :key="index">{{item}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "empty",
		props: {
			text: {
				type: String,
				default: ""
			}
		},
		data() {
			return {
				texts: []
			}
		},
		created() {
			if (this.text) {
				this.texts = this.text.split('/n')
			} else {
				this.texts = ['~ ' + this.i18n_t('暂无数据') + ' ~']
			}
		},
	}
</script>

<style lang="scss" scoped>
	.empty-view {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		opacity: 1;
		width: 100%;
		padding: 50rpx 0;

		.ioc {
			width: 200rpx;
			height: 200rpx;
		}

		.text-view {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-top: 20rpx;

			.empty-text {
				font-size: 24rpx;
				color: #333333;
				opacity: .8;
				letter-spacing: 4rpx;
			}
		}



	}
</style>